Skip to content

Aarch64 asm: Have software fallback and CPU id checks#10754

Open
SparkiDev wants to merge 1 commit into
wolfSSL:masterfrom
SparkiDev:arm64_asm_c_fallback
Open

Aarch64 asm: Have software fallback and CPU id checks#10754
SparkiDev wants to merge 1 commit into
wolfSSL:masterfrom
SparkiDev:arm64_asm_c_fallback

Conversation

@SparkiDev

@SparkiDev SparkiDev commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

cpuid.h — added CPUID_ASIMD flag + IS_AARCH64_ASIMD() macro (NEON detection).
cpuid.c — added NEON/ASIMD detection fixed FreeBSD/OpenBSD to use HWCAP_*
sha256.c — runtime dispatch SHA256-crypto → NEON → software
sha512.c — replaced the #error with the same crypto → NEON → software dispatch.
chacha.c: add AArch64 runtime fallback to C.
poly1305.c: add AArch64 runtime fallback to C.

Fixes
test_tls.c: don't memcpy into buffer if length is too long.
sha256.c: even if data is not NULL, return immediately when length is 0.

Testing

Regression tested Aarch64 platforms.

@SparkiDev SparkiDev self-assigned this Jun 22, 2026
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #10754

Scan targets checked: wolfcrypt-bugs, wolfcrypt-rs-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread wolfcrypt/src/sha256.c Outdated
cpuid.h — added CPUID_ASIMD flag + IS_AARCH64_ASIMD() macro (NEON detection).
cpuid.c — added NEON/ASIMD detection fixed FreeBSD/OpenBSD to use HWCAP_*
sha256.c — runtime dispatch SHA256-crypto → NEON → software
sha512.c — replaced the #error with the same crypto → NEON → software dispatch.
chacha.c: add AArch64 runtime fallback to C.
poly1305.c: add AArch64 runtime fallback to C.

Fixes
test_tls.c: don't memcpy into buffer if length is too long.
sha256.c: even if data is not NULL, return immediately when length is 0.
@SparkiDev SparkiDev force-pushed the arm64_asm_c_fallback branch from 030ceff to d92491c Compare June 23, 2026 03:03
@SparkiDev

SparkiDev commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Jenkins: retest this please

Checkout failed - agent went down
FIPS failure and again
Agent offline
curl failed to get file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants